export default {
  props: {
    formType: {
      type: String,
      default: ''
    },
    readonly: {
      type: Boolean,
      default: false
    }
  },
  created () {
    console.log('接收参数', this.formType);
  },
  methods: {
    submitForm (formName) {
      console.log(this.ruleForm);
      this.$refs[formName].validate((valid) => {
        if (!valid) {
          console.log('error submit!!');
          return false;
        }
        this.onCancel(true, this.ruleForm);
      });
    },
    resetForm (formName) {
      this.$refs[formName].resetFields();
    },
    onCancel (isSuccess, data) {
      if (this.observer != null) {
        this.observer.cancel(isSuccess, data);
      }
    }
  }
}
